package blog.beans;

import java.util.Date;

/**
 * @author johdah <info@johandahlberg.com>
 */
public class Comment implements java.io.Serializable {
    private Integer CId;
    private int PId;
    private int UId;
    private String title;
    private Date datetime;
    private String text;

    public Comment() {
        
    }

    public Comment(int PId, int UId, String title, Date datetime, String text) {
        this.PId = PId;
        this.UId = UId;
        this.title = title;
        this.datetime = datetime;
        this.text = text;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Comment)) {
            return false;
        }
        Comment other = (Comment) object;
        if ((this.CId == null && other.CId != null) || (this.CId != null && !this.CId.equals(other.CId))) {
            return false;
        }
        return true;
    }
   
    public Integer getCId() {
        return this.CId;
    }
    
    public Date getDatetime() {
        return this.datetime;
    }
    
    public int getPId() {
        return this.PId;
    }
    
    public String getText() {
        return this.text;
    }
    
    public String getTitle() {
        return this.title;
    }
    
    public int getUId() {
        return this.UId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (CId != null ? CId.hashCode() : 0);
        return hash;
    }
    
    public void setCId(Integer CId) {
        this.CId = CId;
    }
    
    public void setDatetime(Date datetime) {
        this.datetime = datetime;
    }
    
    public void setPId(int PId) {
        this.PId = PId;
    }
    
    public void setText(String text) {
        this.text = text;
    }
    
    public void setTitle(String title) {
        this.title = title;
    }
    
    public void setUId(int UId) {
        this.UId = UId;
    }

    @Override
    public String toString() {
        return "blog.beans.Comment[ cId=" + CId + " ]";
    }
}